<template>
  <div>
    <router-view/>
    <bottom v-if="isShow"></bottom>
  </div>
</template>

<script setup>
import bottom from "@/components/bottom.vue"
import { useRouter } from 'vue-router';
import { ref } from 'vue';

const isShow = ref(true);
const router = useRouter();

// 一些页面不需要底部导航
// 白名单
const whiteList = ['/talks','/picture','/video','/askQuestion','/question'];
router.beforeEach((to, from, next) => {
  //console.log(to.path);
  if (whiteList.includes(to.path)) {
    isShow.value = false;
    // 拦截后放行
    next();
  } else {
    isShow.value = true;
    next();
  }

});
</script>

<style lang="less" scoped>

</style>